package cn.gene.store.order.webapi.utils;

import org.springframework.web.client.RestTemplate;

/**
 * IdGeneratorUtils*
 *
 * @author LWG
 * @date 2022/7/23 11:32
 * @since 1.0.0@gene.cn
 */
public class IdGeneratorUtils {

    private static final RestTemplate restTemplate = new RestTemplate();

    public static Long getDistributeId(String key) {
        String url = "http://127.0.0.1:9090/api/segment/get/" + key;
        return restTemplate.getForObject(url, Long.class);
    }
}
